package P3;

import jmetal.base.Variable;

public class Strategy extends Variable{

	private boolean[] transition;
	private int[] pacing;

	public Strategy(int size){
		this.transition = new boolean[size];
		this.pacing = new int[size+1];
	}
	public Strategy(boolean[] pac, int[] pow){
		int size = pac.length;
		this.transition = new boolean[size];
		this.pacing = new int[size+1];
		int i;
		for(i =0; i<size; i++){
			this.transition[i] = pac[i];
			this.pacing[i] = pow[i];
		}
		pacing[i] = pow[i];
	}
	
	public Variable deepCopy() {
		int size = transition.length;
		Strategy res = new Strategy(size);
		int i;
		for(i = 0; i<size; i++){
			res.transition[i] = this.transition[i];
			res.pacing[i] = this.pacing[i];
		}
		res.pacing[i] = this.pacing[i];
		return res;
	}

	public void setPacingValue(boolean value, int index){
		this.transition[index] = value;
	}
	
	public void setPowerValue(int value, int index){
		this.pacing[index] = value;
	}
	
	public boolean[] getTransition(){
		return this.transition;
	}
	
	public int[] getPacing(){
		return this.pacing;
	}
}
